package com.haoze.nurseapp.controller;


import com.haoze.common.response.Result;
import com.haoze.nurseapp.dao.MealListMapper;
import com.haoze.nurseapp.service.MealListService;
import com.haoze.nurseapp.service.OperationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: lufq
 * @CreateTime: 2020-12-05
 */
@RestController
@Api(value = "手术预约查询")
@RequestMapping("/nurseapp/operation")
public class OperationController {
    @Autowired
    private OperationService operationService;


    /**
     * 查询
     * @param page
     * @param pageSize
     * @param wardId
     * @return
     */
    @GetMapping("/query")
    @ApiOperation(value = "手术预约查询")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "page", value = "页数", required = true),
            @ApiImplicitParam(name = "pageSize", value = "页长", required = true),
            @ApiImplicitParam(name = "wardId", value = "病区", required = true),
            @ApiImplicitParam(name = "dateTime", value = "时间", required = false),
            @ApiImplicitParam(name = "keyWords", value = "住院号/姓名", required = false)
    })
    public Result query(@RequestParam int page, @RequestParam int pageSize,
                        @RequestParam String wardId, @RequestParam(required = false) String dateTime,
                        @RequestParam(required = false)String keyWords) {
        return operationService.query(page,pageSize,wardId,dateTime,keyWords);
    }
}
